#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/12/2 19:34
# @Author : xjp
# @Site : 
# @File : Discriminator.py
# @Software: PyCharm
import tensorflow as tf
from tensorflow import keras
class Discriminator(keras.Model):
    def __init__(self):
        super(Discriminator, self).__init__()
        self.dense_1 = tf.keras.layers.Dense(40,kernel_initializer=keras.initializers.he_normal(),
                      activation=tf.nn.leaky_relu)
        # self.bn_1 = tf.keras.layers.BatchNormalization()
        self.dense_2 = tf.keras.layers.Dense(30,kernel_initializer=keras.initializers.he_normal(),
                      activation=tf.nn.leaky_relu)
        # self.bn_2 = tf.keras.layers.BatchNormalization()
        self.dense_3 = tf.keras.layers.Dense(10,kernel_initializer=keras.initializers.he_normal(),
                      activation=tf.nn.leaky_relu)
        # self.bn_3 = tf.keras.layers.BatchNormalization()
        self.dense_4 = tf.keras.layers.Dense(1)
    def call(self, inputs, training=None, mask=None):
        dense_1 = self.dense_1(inputs)
        # bn_1= self.bn_1(dense_1)
        dense_2 = self.dense_2(dense_1)
        # bn_2 = self.bn_2(dense_2)
        dense_3 = self.dense_3(dense_2)
        # bn_3 = self.bn_3(dense_3)
        dis_out = self.dense_4(dense_3)
        return dis_out


